package com.zkthink.ceres.promotion.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zkthink.base.R;
import com.zkthink.base.request.PageParams;
import com.zkthink.base.service.SuperService;
import com.zkthink.ceres.promotion.dto.SalesApplyDTO;
import com.zkthink.ceres.promotion.dto.SalesPageDTO;
import com.zkthink.ceres.promotion.dto.SalesUpdateDTO;
import com.zkthink.ceres.promotion.entity.Sales;
import com.zkthink.ceres.promotion.entity.SalesCustomer;
import com.zkthink.ceres.promotion.entity.SalesOrder;
import com.zkthink.ceres.promotion.vo.admin.SalesAdminPageVO;
import com.zkthink.ceres.promotion.vo.admin.SalesOrderPageVO;
import com.zkthink.ceres.promotion.vo.admin.SalesPerformanceAdminVO;
import com.zkthink.ceres.promotion.vo.admin.SalesPerformanceDetailAdminVO;
import com.zkthink.ceres.promotion.vo.web.SalesCustomerVO;
import com.zkthink.ceres.promotion.vo.web.SalesMainInfoVO;
import com.zkthink.ceres.promotion.vo.web.SalesStoreVO;
import com.zkthink.ceres.promotion.vo.web.SubordinateSalesVO;

/**
 * <p>
 * 业务接口 分销员
 * </p>
 *
 * @author kellen
 * @date 2020-08-22
 */
public interface SalesService extends SuperService<Sales> {


  IPage<SalesAdminPageVO> page(PageParams<SalesPageDTO> params);

  R quit(Long salesId);

  R updateSales(SalesUpdateDTO updateDTO);

  IPage<SalesPerformanceAdminVO> querySalesPerformance(PageParams<SalesPageDTO> params);

  SalesPerformanceDetailAdminVO querySalesPerformanceDetail(Long salesId);

  Sales queryByMidAndTenantCode(Long mid,String tenantCode);

  void saveSales(SalesApplyDTO salesApplyDTO);

  /**
   * 分页查询该用户关联的销售店铺
   * @param mid
   * @param pageParams
   * @return
   */
  IPage<SalesStoreVO> findSaleStoreList(Long mid, PageParams<Sales> pageParams);

  /**
   * 查询分销员在该店铺下的一些主要信息
   * @param mid
   * @param tenantCode
   * @return
   */
  SalesMainInfoVO querySalesMainInfo(Long mid, String tenantCode);

  /**
   * 查询分销员在该店铺下的收益(即累计奖励)
   * @param pageParams 分页参数
   * @return
   */
  IPage<SalesOrderPageVO> findSalesOrderPage(PageParams<SalesOrder> pageParams);

  /**
   * 前端查询累计客户
   * @param pageParams 分页参数
   * @return
   */
  IPage<SalesCustomerVO> findSalesCustomerList(PageParams<SalesCustomer> pageParams);

  /**
   * 查询下级分销员列表
   * @param pageParams 分页参数
   * @return
   */
  IPage<SubordinateSalesVO> findSubordinateSalesList(PageParams<Sales> pageParams);

  /**
   * 查询我的分销订单
   * @param pageParams 分页参数
   * @return
   */
  IPage<SalesOrderPageVO> findMySalesPage(PageParams<SalesOrder> pageParams);

}
